package com.wn.class30.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * user
 * @author 
 */
@Data
@NoArgsConstructor
public class User implements Serializable {
    /**
     * 用户ID
     */
    private Integer userId;

    /**
     * 用户姓名
     */
    private String username;

    /**
     * 用户手机号
     */
    private String tel;

    /**
     * 注册日期
     */
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date registertime;

    /**
     * 会员等级ID
     */
    private Integer lvId;
    private Vip vip;
    /**
     * 成长值
     */
    private Integer points;

    /**
     * 公众号唯一标识
     */
    private String openid;

    private String headUrl;

    /**
     * 订阅情况 1代表订阅，0代表未订阅
     */
    private Integer subscribeState;

    private static final long serialVersionUID = 1L;


    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", userId=").append(userId);
        sb.append(", username=").append(username);
        sb.append(", tel=").append(tel);
        sb.append(", registertime=").append(registertime);
        sb.append(", lvId=").append(lvId);
        sb.append(", points=").append(points);
        sb.append(", openid=").append(openid);
        sb.append(", headUrl=").append(headUrl);
        sb.append(", subscribeState=").append(subscribeState);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}